package com.party.core.model.commune;

import com.party.core.model.BaseModel;

import java.util.Objects;

/**
 * @program: party
 * @description: 积分项
 * @author: Hua Qunhao
 * @create: 2019-08-12 14:05
 **/
public class CIntegralItem extends BaseModel {
    //普通等级
    public static final Integer CINTEGRALITEM_GRADE_ORDINARY = 1;
    //其他等级
    public static final Integer CINTEGRALITEM_GRADE_OTHER = 2;

    //'积分项名称'
    private String name;
    //'积分类型id'
    private String typeId;
    //'分数'
    private Double itemFraction;
    //积分类型名称
    private String typeName;

    //推荐等级（默认等级<自动维护推荐关系>----> 1； 其他等级<手动维护推荐关系>------->2）
    private Integer recommendGrade;
    //赠送等级 (1:默认，2:其他)
    private Integer giftGrade;


    public CIntegralItem() {
    }

    public CIntegralItem(String name, String typeId) {
        this.name = name;
        this.typeId = typeId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public Double getItemFraction() {
        return itemFraction;
    }

    public void setItemFraction(Double itemFraction) {
        this.itemFraction = itemFraction;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String cTypeName) {
        this.typeName = cTypeName;
    }

    public Integer getRecommendGrade() {
        return recommendGrade;
    }

    public void setRecommendGrade(Integer recommendGrade) {
        this.recommendGrade = recommendGrade;
    }

    public Integer getGiftGrade() {
        return giftGrade;
    }

    public void setGiftGrade(Integer giftGrade) {
        this.giftGrade = giftGrade;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        CIntegralItem that = (CIntegralItem) o;
        return Objects.equals(name, that.name) &&
                Objects.equals(typeId, that.typeId) &&
                Objects.equals(itemFraction, that.itemFraction) &&
                Objects.equals(typeName, that.typeName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), name, typeId, itemFraction, typeName);
    }

    @Override
    public String toString() {
        return "CIntegralItem{" +
                "name='" + name + '\'' +
                ", typeId='" + typeId + '\'' +
                ", itemFraction=" + itemFraction +
                ", cTypeName='" + typeName + '\'' +
                '}';
    }
}
